home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / Development Tools & Languages / DTSCPlusLibrary / Sources / Window.h < prev   
Encoding:
Text File  |  1993-01-14  |  2.7 KB  |  83 lines  |  [TEXT/MPS ]

  1. /* _________________________________________________________________________________________________________ //
  2.   Copyright © 1992-93 Apple Computer, Inc. All rights reserved.
  3.   Macintosh Developer Technical Support.C++ Macintosh Toolbox Framework.
  4.   Date: 11/7/92
  5.   Revision comments are at the end of this file.
  6.   ---
  7.   TWindow is a Window wrapper class that handles most of the basic window functionality.
  8.   Window.h contains the TWindow class definition.
  9.   _________________________________________________________________________________________________________ */
  10.  
  11. // Declare label for this header file
  12. #ifndef _WINDOW_
  13. #define _WINDOW_
  14.  
  15. #ifndef _DTSCPLUSLIBRARY_
  16. #include "DTSCPlusLibrary.h"
  17. #endif
  18.  
  19. #ifndef __WINDOWS__
  20. #include <Windows.h>
  21. #endif
  22.  
  23. #ifndef _ENVIRONMENT_
  24. #include "Environment.h"
  25. #endif
  26.  
  27.  
  28. // _________________________________________________________________________________________________________ //
  29. //    TWindow Class Interface.
  30. class TWindow
  31. // TWindow is a simple Window class that could be used to produce simple window objects.
  32. {
  33. public:
  34.     // TYPEDEFS AND ENUMS
  35.     enum ECoordinates                            // used to define the default window size/position
  36.     {
  37.         kTop = 50, kLeft = 50, kBottom = 275, kRight = 275
  38.     };
  39.  
  40.     // CONSTRUCTORS AND DESTRUCTORS
  41.     TWindow();                                    // default constructor
  42.     TWindow(short windowID);                    // create a window based on a resource ID
  43.     virtual~ TWindow();                            // default destructor
  44.  
  45.     virtual void Initialize();                    // initialize fields to known values
  46.  
  47.     // MAIN INTERFACE
  48.     virtual void Draw();                        // the main drawing routine
  49.     virtual void DoClick();                        // handle mouse clicks inside window
  50.     virtual void Show();                        // show window
  51.     virtual void Hide();                        // hide window
  52.  
  53.     // GET/SET FUNCTIONS
  54.     virtual WindowPtr GetWindowPtr() const;        // get the object's WindowPtr
  55.     virtual void SetTitle(const Str255* title);    // set window title
  56.     virtual void GetTitle(Str255* result) const;// get window title
  57.     virtual Rect GetExtent() const;                // get window interior rect
  58.     virtual Rect GetFrame() const;                // get window frame rect
  59.     virtual Boolean Contains(Point test) const;    // test if point is inside window
  60.     virtual Boolean IsColorWindow() const;        // color window or not?
  61.  
  62.     // FIELDS
  63. protected:
  64.     WindowPtr fWindow;                            // our single WindowPtr
  65.     WindowPeek fWindowRecord;                    // pointer to the window record
  66.     Str255 fWindowTitle;                        // out window title
  67.     Rect fRect;                                    // the rect for the window
  68.     Boolean fColorWindow;                        // enabled if the window supports Color QD
  69. };
  70.  
  71.  
  72. #endif
  73.  
  74. // _________________________________________________________________________________________________________ //
  75.  
  76.  
  77. /*    Change History (most recent last):
  78.   No        Init.    Date        Comment
  79.   1            khs        11/7/92        New file
  80.   2            khs        1/7/93        Cleanup
  81. */
  82.  
  83.